#include <string>
#include "error.h"
#include "State.h"

State::State(const std::string& s) : state(s) { }

bool State::operator<(const State& s) const {
	return state.compare(s.state) < 0;
}

bool State::operator!=(const State& s) const {
	return state != s.state;
}

void State_Set::add_state(const std::string& state) {
	if(state_set.insert(state).second == false)
		error("state already exists");
}

State State_Set::operator()(const std::string& s) const {
	return State(s);
}
